Ensure helper classes are available in production

Due to eager_loading being active in production helper classes in lib need to be explicitly required.

Dominik Sander 7 years ago
parent
commit
5cfca6bf68

+ 2 - 0
app/controllers/scenarios_controller.rb

@@ -1,3 +1,5 @@
1
+require 'agents_exporter'
2
+
1 3
 class ScenariosController < ApplicationController
2 4
   include SortableTable
3 5
   skip_before_action :authenticate_user!, only: :export

+ 2 - 1
app/models/agents/google_calendar_publish_agent.rb

@@ -91,7 +91,8 @@ module Agents
91 91
     end
92 92
 
93 93
     def receive(incoming_events)
94
-     incoming_events.each do |event|
94
+      require 'google_calendar'
95
+      incoming_events.each do |event|
95 96
         calendar = GoogleCalendar.new(interpolate_options(options, event), Rails.logger)
96 97
 
97 98
         calendar_event = JSON.parse(calendar.publish_as(interpolated(event)['calendar_id'], event.payload["message"]).response.body)

+ 2 - 0
app/models/agents/http_status_agent.rb

@@ -1,3 +1,5 @@
1
+require 'time_tracker'
2
+
1 3
 module Agents
2 4
 
3 5
   class HttpStatusAgent < Agent

+ 2 - 0
db/migrate/20140505201716_migrate_agents_to_liquid_templating.rb

@@ -1,3 +1,5 @@
1
+require 'liquid_migrator'
2
+
1 3
 class MigrateAgentsToLiquidTemplating < ActiveRecord::Migration
2 4
   class Agent < ActiveRecord::Base
3 5
     include JSONSerializedField